/**
 * 
 */
package org.vsg.common.pagination.carrier;

import java.io.Serializable;

import org.vsg.common.pagination.PageIndexOutOfBoundsException;
import org.vsg.common.pagination.PaginationConstant;

/**
 * @author Bill Vison
 *
 */
public abstract class AbstractBaseValueCarrier implements ValueCarrier, Serializable {
	
	protected int pageIndex;
	
	protected int pageSize = PaginationConstant.DEFAULT_PAGESIZE;
	

	public int getPageIndex(){
		return pageIndex;
	}

	public void setPageIndex(int goToPage) throws PageIndexOutOfBoundsException{
		if (goToPage < 0) {
			throw new PageIndexOutOfBoundsException("Enter page number must over zero!");
		}
		this.pageIndex = goToPage;
	}

	/**
	 * @return Returns the pageSize.
	 */
	public int getPageSize() {
		return pageSize;
	}

	/**
	 * @param pageSize The pageSize to set.
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	
}
